home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / dosex / ex5.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  318 b   |  16 lines

  1. Program Example5;
  2. uses Dos;
  3.  
  4. { Program to demonstrate the Exec and DosExitCode function. }
  5.  
  6. begin
  7. {$IFDEF LINUX}
  8.   WriteLn('Executing /bin/ls -la');
  9.   Exec('/bin/ls','-la');
  10. {$ELSE}
  11.   WriteLn('Executing Dir');
  12.   Exec(GetEnv('COMSPEC'),'/C dir');
  13. {$ENDIF}
  14.   WriteLn('Program returned with ExitCode ',DosExitCode);
  15. end.
  16.